export const edit = {
	data() {
		return {
			option: [],
			adminOptin: [],
			parameter: {},
			swipeList: []
		}
	},
	methods: {
		initPage() {
			this.parameter = JSON.parse(this.detail.parameter);
			this.adminOptin = [];
			if (this.parameter.layout == 2) {
				this.adminOptin = [];
				this.option = JSON.parse(this.detail.option_val).filter(item => {
					if (item.businessEdit && item.value) {
						this.adminOptin.push({
							...item
						});
					}
					if (item.componentName == 'FormAdvert' || item.businessEdit || !item.value) {
						return false;
					} else {
						return true;
					}
				});
			} else {
				this.option = JSON.parse(this.detail.option_val).filter(item => {
					if (!item.value) {
						return false;
					} else {
						return true;
					}
				});
			}
			if (this.parameter.img) {
				this.swipeList = this.parameter.img.split(',').map(item => {
					return {
						img: item
					};
				});
			}
		}

	}
}
